/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.Solenoid;

/**
 *
 * @author Saketh Kasibatla
 */
public class Piston
    {
            protected final Solenoid front;
            protected final Solenoid back;

            public Piston(int front_id, int back_id)
            {
                this.front = new Solenoid(front_id);
                this.back = new Solenoid(back_id);
            }

            public void shoot()
            {
                front.set(false);
                back.set(true);
            }

            public void retract()
            {
                front.set(true);
                back.set(false);
            }

            public boolean isFrontOpen()
            {
                return front.get();
            }

            public boolean isBackOpen()
            {
                return back.get();
            }

            public boolean isShootPos()
            {
                return !front.get() && back.get();
            }

            public boolean isRetractPos()
            {
                return front.get() && !back.get();
            }
    }
